  @extends('master')

@section('title')
Scool|Record
@endsection

@section('content')

 <!-- right-top -->
    <div class="right-info" id="scrol3">
      <div class="right-info-wrapper" id="right-info-wrapper">
       
        <!-- height_22 -->
        <div class="table-list-info">
          <div class="panel panel-default">
            <div class="panel-heading">
              <div class="create-info">
                <div class="create-info-left"> <span>Admin User 列表</span> </div>
                <!-- create-info-left -->
               <div class="create-info-right"> <a href="/admin-user/create" class="btn btn-default create_btn"> 新建user </a> </div>
                <!-- create-info-right -->
                <div class="clear"></div>
                <!-- clear --> 
              </div>
              <!-- create-info --> 
            </div>
            <!-- panel-heading -->
            <div class="panel-body">
              <div class="table-detail table-responsive">
                <table class="table table-condensed table-pad">
                  <thead>
                    <tr>
                      <th>Id</th>
                      <th>User</th>
                      <th>Create Time</th>
                      <th>Status</th>
                      <th>Action</th>
                    </tr>
                  </thead>
                  <tbody>
                   <?php foreach($data as $value): ?>
                    <tr>
                      <td ><?php echo $value->id;?>
                      <td ><?php echo $value->user ?></td>
                      <td><?php echo date('Y-m-d h:s:i', $value->create_time) ?>
                      <td ><?php echo $value->status ? '正常' : '删除'; ?></td>
                      <td><!-- Single button -->
                        
                        <div class="btn-group">
                          <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Action <span class="caret"></span> </button>
                          <ul class="dropdown-menu">
                        
                            <!-- <li><a href="/record/update?id=<?php echo $value->id; ?>">修改record</a></li> -->
                            <?php if($value->status): ?>
                            <li><a href="javascript:;"   data-id="<?php echo $value->id ?>" class="delete">停用User</a></li>
                            <?php else:?>
                            <li><a href="javascript:;"   data-id="<?php echo $value->id ?>" >已经停用</a></li>
                            <?php endif; ?>
                                   
                          </ul>
                        </div>
                        </td>
                    </tr>
                  <?php endforeach; ?>

                  <?php if(!$data): ?>
                     <tr> <td colspan="5" class="td-pad">No data found</td></tr>
                    <?php endif;?>   
                      
                  </tbody>
                </table>
              </div>
              <!-- table-detail --> 
            </div>
            <span class="span_top"><?php echo $data->total(); ?> Records</span>{!! $data->render() !!}
            <!-- panel-body --> 
          </div>
          <!-- panel --> 
        </div>
        <!-- table-list-info -->
        <div class="height_50"></div>
        <!-- height_50 --> 
      </div>
      <!-- right-info-wrapper --> 
    </div>
    <!-- right-info --> 

@endsection


@section('js')
<!-- <script type="text/javascript"  src="/js/autocomplete.js"></script> -->
<script type="text/javascript"  src="/js/adminUser/index.js"></script>
@endsection